package com.rigsofrods.truckeditor.geometry;

import java.awt.Color;

import com.rigsofrods.truckeditor.transforms3D.Mat4;
import com.rigsofrods.truckeditor.transforms3D.Mat4Identity;

public abstract class Object3D {
	public String objectName = "";
	protected static final int DEFAULT_COLOR = (new Color(63,63,255).getRGB());
	public Mat4 mtxTransformation = new Mat4Identity();
	protected boolean sellected = false;
	protected boolean sellectable = true;
	
	public Object3D() {
		this("Empty", true);
	}
	
	public Object3D(String objectName) {
		this(objectName, true);
	}	
	
	public Object3D(String objectName, boolean sellectable) {
		this.sellectable = sellectable;
		this.objectName = objectName;
	}
	
	//public abstract void draw(IRenderer renderer);
	
	/* consider leaving object transformations to Engine as the final
	 * transformation matrix is pre-calculated and so far every vertex is
	 * multiplied by the view mat. anyway
	 * DONE*/
	public void transform(Mat4 mtxTransform) {
		mtxTransformation = mtxTransformation.mul(mtxTransform);		
	}
	
	public boolean isSellected() {
		return sellected;
	}

	public void setSellected(boolean sellected) {
		this.sellected = sellected;
	}
	
	public boolean isSellectable() {
		return sellectable;
	}

	public void setSellectable(boolean sellectable) {
		this.sellectable = sellectable;
	}
}